class MsnRouter(object):
	def db_for_read(self, model, **hints):
		if model._meta.app_label == 'msn':
			return 'crawlmsn'
		else:
			return None
	
	def db_for_write(self, model, **hints):
		if model._meta.app_label == 'msn':
			return 'crawlmsn'
		else:
			return None
	
	def allow_relation(self, obj1, obj2, **hint):
		return None
	
	def allow_syncdb(self, db, model):
		if db == 'crawlmsn':
			print model._meta.app_label
			return model._meta.app_label=='msn' or model._meta.app_label=='auth' or model._meta.app_label=='contenttypes' or model._meta.app_label=='sessions' or model._meta.app_label=='sites'
		elif model._meta.app_label == 'msn':
			return False
		return None
		
class QzoneRouter(object):
	def db_for_read(self, model, **hint):
		if model._meta.app_label == 'qzone':
			return 'default'
		else:
			return None
	
	def db_for_write(self, model, **hint):
		if model._meta.app_label == 'qzone':
			return 'default'
		else:
			return None
	
	def allow_relation(self, obj1, obj2, **hint):
		return None
	
	def allow_syncdb(self, db, model):
		if db == 'default':
			return model._meta.app_label=='qzone' or model._meta.app_label=='auth' or model._meta.app_label=='contenttypes' or model._meta.app_label=='sessions' or model._meta.app_label=='sites'
		elif model._meta.app_label == 'qzone':
			return False
		return None
